var LogManage = function(){
	var normalGridObj=null;
	function initNormalGridObj(){
		if(normalGridObj == null){
			normalGridObj = $.fn.bsgrid.init('normalLogsTable', {
	            url:contextPath+"/sys/log/list.htm",
	            pageSizeSelect: true,
	            stripeRows: true,
	            rowSelectedColor:false,
	            pageSize: 10,
	            otherParames:{"queryName":null,"beginTime":null,"endTime":null},
	            complete:function(options, XMLHttpRequest, textStatus){
	            	AppUtils.bsgridExportButton(options);
				}
				
	        });
		}else{
			normalGridObj.refreshPage();
		}
	}
	return {
		initPage:function(){
			initNormalGridObj();
		},
		searchName:function(){
			normalGridObj.search({"queryName":$("#query_name").val(),"beginTime":$("#startTime").val(),"endTime":$("#endTime").val()});
		},
		searchByTime:function(){
			var beginTime = $("#startTime").val();
			var endTime = $("#endTime").val();
			if(beginTime == "" || endTime == "" ){
				if(!(beginTime==""&& endTime=="")){
					Message.alert("请选择正确的时间范围。");
					return false;
				}
			}
			if(!AppUtils.dateCompare(beginTime,endTime)){
				Message.alert("截至时间不能早于起始时间。");
				return false;
			}
			normalGridObj.search({"queryName":$("#query_name").val(),"beginTime":beginTime,"endTime":endTime});
		}
	}
	
}();